cmake_minimum_required(VERSION 3.24)

# 设置项目名称和语言
project(startlite VERSION 1.0 LANGUAGES CXX)

set(SOURCES
    main.cpp
)

# 添加可执行文件
add_executable(startlite ${SOURCES})

# 链接 xlitecore 库
target_link_libraries(startlite PRIVATE ${CMAKE_BINARY_DIR}/Startlite/core/xlitecore/Debug/xlitecore.lib)

#set(XLiteCore_DIR ${CMAKE_BINARY_DIR}/Startlite/core/xlitecore/Debug)
#find_package(${CMAKE_BINARY_DIR}/Startlite/core/xlitecore/Debug COMPONENTS xlitecore REQUIRED)

# 添加包含目录（如果 DLL 提供了头文件）
target_include_directories(startlite PRIVATE
    ${CMAKE_SOURCE_DIR}/include  # 替换为头文件路径
)

# 复制 DLL 到构建目录
add_custom_command(TARGET startlite POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
    ${CMAKE_BINARY_DIR}/Startlite/core/xlitecore/Debug/xlitecore.dll
    $<TARGET_FILE_DIR:startlite>)